
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-toolbar clearfix">

                    <form class="form-inline pull-right" method="get" action="/rolegroup/index" role="form">
                        <div class="input-group">
                            {$selector|raw}
                        </div>
                        <div class="input-group">
                            <input type="text" class="form-control " value="{$Request.get.keyword}" name="keyword" placeholder="">
                            <span class="input-group-btn">
                                <button class="btn btn-success" type="submit">搜索</button>
                            </span>
                        </div>
                    </form>
                    <div class="toolbar-btn-action">
                        <a class="btn btn-primary m-r-5 js-create-tab" data-url="/rolegroup/add.html" data-title="新增权限组" ><i class="mdi mdi-plus"></i> 新增</a>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>权限组名称</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $list as $key=>$vo }
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.group_name}</td>
                                <td>
                                    <div class="btn-group">
                                        <a class="btn btn-xs btn-default js-create-tab" data-toggle="tooltip" data-original-title="编辑"  href="javascript:;" data-url="/rolegroup/update.html?id={$vo.id}" data-title="编辑权限组" ><i class="mdi mdi-pencil"></i></a>
                                        <a class="btn btn-xs btn-default js-create-tab" data-toggle="tooltip" data-original-title="选择节点"  href="javascript:;" data-url="/rolegroup/addpath.html?id={$vo.id}" data-title="选择节点" ><i class="mdi mdi-plus-outline"></i></a>
                                        <a class="btn btn-xs btn-default" href="javascript:;" data-toggle="tooltip" data-original-title="删除" onclick="del('{$vo.id}')"><i class="mdi mdi-window-close"></i></a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}

                            </tbody>
                        </table>
                    </div>

                    {php}echo $page;{/php}
                </div>
            </div>
        </div>

    </div>

</div>

<script type="text/javascript">
    $(function(w){
        w.del = function del(id){
            if(confirm('确定删除?')){
                $._ajax({
                    url: '/rolegroup/del',
                    data: {
                        id:id
                    }
                }).done(function(data){
                    if(data){
                        lightyear.notify('删除成功~', 'success');
                        setTimeout(function() {
                            window.location.reload();
                        }, 1e3);
                    }else{
                        lightyear.notify('删除失败~', 'danger');
                        setTimeout(function() {
                            window.location.reload();
                        }, 1e3);
                    }
                });
            }
        }
    }(window));
</script>
